Package com.fsf.news.renderer
Class NewsRendererTest
java.lang.Object
com.fsf.news.renderer.NewsRendererTest
@ExtendWith(GuiceExtension.class) @ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
class NewsRendererTest
extends Object
Unit tests for the NewsRenderer class.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) com.fasterxml.jackson.databind.ObjectMapper(package private) com.fsf.news.renderer.NewsRenderer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidTests that the renderSearchResults method generates the expected HTML for a list of search results.(package private) voidTests that the renderSearchResults method generates an empty HTML string for an empty list of search results.(package private) voidTests that the renderSourceProfile method generates the expected HTML for a source profile.(package private) voidTests that the renderSourcesResults method generates the expected HTML for a list of sources results.(package private) voidTests that the renderSourcesResults method generates an empty HTML string when provided with an empty list of sources results.
-
Field Details
-
objectMapper
@Inject @Named("objectMapperJSON") com.fasterxml.jackson.databind.ObjectMapper objectMapper -
renderer
@InjectMocks com.fsf.news.renderer.NewsRenderer renderer
-
-
Constructor Details
-
NewsRendererTest
NewsRendererTest()
-
-
Method Details
-
testRenderSearchResults
Tests that the renderSearchResults method generates the expected HTML for a list of search results.- Throws:
IOException- If an I/O error occurs
-
testRenderSearchResultsEmpty
@Test void testRenderSearchResultsEmpty()Tests that the renderSearchResults method generates an empty HTML string for an empty list of search results. -
testRenderSourcesResults
Tests that the renderSourcesResults method generates the expected HTML for a list of sources results.- Throws:
IOException- If an I/O error occurs while reading test resources
-
testRenderSourcesResultsEmpty
@Test void testRenderSourcesResultsEmpty()Tests that the renderSourcesResults method generates an empty HTML string when provided with an empty list of sources results. -
testRenderSourceProfile
Tests that the renderSourceProfile method generates the expected HTML for a source profile.- Throws:
IOException- If an I/O error occurs while reading test resources
-